<%@page contentType="text/html;charset=utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>生成订单 - 当当网</title>
		<link href="../css/login.css" rel="stylesheet" type="text/css" />
		<link href="../css/page_bottom.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../js/jquery-1.4.3.js"></script>
		<script type="text/javascript" charset=utf-8 src="../js/address.js"></script>
		<script type="text/javascript">
		/*
		//window.onload=function(){
  		alert(222)
  				var arr = new Array();
				
				//arr[1]=[new Option('商务英语','en1'),new Option('英语文学','en2')];
				//for(i=0;i<arr[1].length;i++){
				//	document.getElementById('address').options[i]=arr[1][i];
			//	}
			
				$.ajax({
					type:'post',
					url:'getadd',
					data:'',
					success:function(data){
					
					alert(data)
					
						
					var arr = new Array();
					var arr1 = new Array();
					arr = data.split('*')
					alert(arr[0])
					//arr[1]=[new Option('商务英语','en1'),new Option('英语文学','en2')];
					var s = "123"
					document.getElementById('address').options[0]=new Option(s,2);
					for(i=0;i<arr.length;i++){
						arr1 = arr[i].split('/');
						
						//document.getElementById('address').options[i]=new Option(arr1[1]);
						//for(n=0;n<arr1.length;n++){
							//$('address').options[i]=arr[2];
						//}
					
					}
					//alert(data[1].address.phone)
					//var e = eval('('+data+')');
					//var user = e.address.phone
					//alert(user)
					alert(123)
						
					}
				})
			
			}
		
		
		
		
		$(function(){
			$('#')
		
			function init(){
			alert(123)
				$.ajax({
					type:'post',
					url:'getadd',
					data:'',
					success:function(data){
					alert(data)
					}
				})
			}
		})
		
			
			*/
		</script>
	</head>
	<body>
		<%@include file="../common/head1.jsp"%>
		<div class="login_step">
			生成订单骤: 1.确认订单 >
			<span class="red_bold"> 2.填写送货地址</span> > 3.订单成功
		</div>
		<div class="fill_message">
			<p>
				选择地址：
				<select id="address" onchange="window.location='getadd.action?addId='+this.value">
					<option value="0">
						填写新地址
					</option>
					<s:iterator value="listAdd">
					<option value="${id}" <s:if test="addId==id">selected="selected"</s:if>>${fullAddress}</option>
					</s:iterator>
				</select>
			</p>
			<form name="address.action" method="post" action="address.action" id="f">
				<input type="hidden" name="addressId" id="addressId" value="<s:property value="addId"/>"/>

				<table class="tab_login">
					<tr>
						<td valign="top" class="w1">
							收件人姓名：
						</td>
						<td>
							<input type="text" class="text_input" name="address.receiveName"
								id="receiveName" value="${userAdd.receiveName}"/>
							<div class="text_left" id="nameValidMsg">
								<p id="j2" style="color:green">
									
								</p>
								<span id="name.info" style="color:red"></span>
							</div>
						</td>
					</tr>
					<tr>
						<td valign="top" class="w1">
							收件人详细地址：
						</td>
						<td>
							<input type="text" name="address.fullAddress" class="text_input"
								id="fullAddress" value="<s:property value="userAdd.fullAddress" /> "/>
							<div class="text_left" id="addressValidMsg">
								<p id="j1" style="color:green">
									
								</p><span id="email.info" style="color:red"></span>
							</div>
						</td>
					</tr>
					<tr>
						<td valign="top" class="w1">
							邮政编码：
						</td>
						<td>
							<input type="text" class="text_input" name="address.postalCode"
								id="postalCode" value="${userAdd.postalCode}" />
							<div class="text_left" id="codeValidMsg">
								<p id="j4" style="color:green">
									
								</p><span id="code.info" style="color:red"></span>
							</div>
						</td>
					</tr>
					<tr>
						<td valign="top" class="w1">
							电话：
						</td>
						<td>
							<input type="text" class="text_input" name="address.mobile"
								id="mobile" value="${userAdd.mobile	}"/>
							<div class="text_left" id="phoneValidMsg">
								<p>
									请填写有效的收件人的电话：
								</p>
							</div>
						</td>
					</tr>
					<tr>
						<td valign="top" class="w1">
							手机：
						</td>
						<td>
							<input type="text" class="text_input" name="address.phone"
								id="phone" value="${userAdd.phone}"/>
							<div class="text_left" id="mobileValidMsg">
								<p id="j5" style="color:green">
									
								</p><span id="phone.info" style="color:red"></span>
								
							</div>
						</td>
					</tr>
				</table>

				<div class="login_in">

					<a href="../cart/cart.action"><input id="btnClientRegister" class="button_1" name="submit"
					type="button" value="取消" /></a>
			
				<input id="btnClientRegister" class="button_1" name="submit"
					type="submit" value="下一步" />
				</div>
			</form>
		</div>
		<%@include file="../common/foot1.jsp"%>
	</body>
</html>

